<template>
	<scroll-view scroll-y="true" class="goods_list_container" @scrolltolower="scrollBottomHandle">
		<GoodsList ref="goodsList" :showType="searchType" :typeValue="searchTypeValue"/>
	</scroll-view>
</template>

<script setup>
import { ref } from "vue";
import { onLoad } from '@dcloudio/uni-app';
import GoodsList from "../../components/GoodsList/GoodsList.vue";

let goodsList = ref(null);
// 过滤类型值
let searchTypeValue = ref("");
// 过滤的类型
let searchType = ref("");

onLoad((options)=>{
	uni.setNavigationBarTitle({
		title:"搜索：" + options.navText
	})
	searchTypeValue.value = options.navText
	searchType.value = options.type
})

// 触底重新获取数据
function scrollBottomHandle(){
	goodsList.value.loadMore(); // 调用子组件的方法进行懒加载
}
</script>

<style lang="scss" scoped>
.goods_list_containerP{
	height: 100vh;
	overflow-y: auto;
}
</style>
